package com.example.helloword.servie;

import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class ServiceTest {
    @Cacheable(value = "xmethod1")
    public String method1(String para)  {
        log.info("method1 begin para={}", para);
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        log.info("method1 end");
        return "meth1";
    }
}
